<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table{
            width :600px;
            margin: 50px auto;
            border: 1px black solid;
            border-collapse: collapse;
           
            
        }
        tr,th,td{
            border: 1px black solid;
        
            text-align: center;
            height: 30px;
            line-height: 30px;
        }
    </style>
</head>
<body>
    <script>
        let num1=prompt("请输入银行卡总额")
        let num2=prompt("请输入水费")
        let num3=prompt("请输入电费")
        let num4=prompt("请输入网费")
        let num5=num1-num2-num3-num4


        document.write( 
        `<table>
        <caption><h1>202年12消费支出</h1></caption>
        <tr>
            <th>银行卡总额</th>
            <th>水费</th>
            <th>电费</th>
            <th>网费</th>
            <th>银行卡余额</th>
        </tr>
        <tr>
            <td>${num1}</td>
            <td>${num2}</td>
            <td>${num3}</td>
            <td>${num4}</td>
            <td>${num5}</td>
        </tr>
    </table>`)
    </script>


   
</body>
</html>